NavUtils
NavUtils provides helper functionality for applications implementing recommended Android UI navigation patterns. For information about recommended navigation patterns see Tasks and Back Stack from the developer guide and Navigation from the design guide.
Functions
Link copied to clipboard
@Nullable
Obtain an Intent that will launch an explicit target activity specified by sourceActivity's PARENT_ACTIVITY element in the application's manifest.
@Nullable
@Nullable
Obtain an Intent that will launch an explicit target activity specified by sourceActivityClass's PARENT_ACTIVITY element in the application's manifest.
Link copied to clipboard
@Nullable
Return the fully qualified class name of sourceActivity's parent activity as specified by a PARENT_ACTIVITY element within the activity element in the application's manifest.
@Nullable
Return the fully qualified class name of a source activity's parent activity as specified by a PARENT_ACTIVITY element within the activity element in the application's manifest.
Link copied to clipboard
Convenience method that is equivalent to calling
navigateUpTo(sourceActivity,
getParentActivityIntent (sourceActivity))
.Link copied to clipboard
open fun navigateUpTo(@NonNull sourceActivity: @NonNull Activity, @NonNull upIntent: @NonNull Intent)
Navigate from sourceActivity to the activity specified by upIntent, finishing sourceActivity in the process.
Link copied to clipboard
open fun shouldUpRecreateTask(@NonNull sourceActivity: @NonNull Activity, @NonNull targetIntent: @NonNull Intent): Boolean
Returns true if sourceActivity should recreate the task when navigating 'up' by using targetIntent.